home *** CD-ROM | disk | FTP | other *** search
- ; alternative to ecvec.asm -- WORKS ON PC/ATs (80826) only!
- .MODEL MEMMOD,C
- .286
- LOCALS
- %MACS
- .LALL
-
- extrn Stktop,Spsave,Sssave,ecint:proc,doret:proc
-
- .CODE
- dbase dw @Data ; save loc for ds (must be in code segment)
-
- ; ec0vec - Ethernet interrupt handler
- public ec0vec
- label ec0vec far
- push ds ; save on user stack
- mov ds,cs:dbase ; establish interrupt data segment
-
- mov Sssave,ss ; stash user stack context
- mov Spsave,sp
-
- mov ss,cs:dbase
- lea sp,Stktop
-
- push ax ; save user regs on interrupt stack
- push bx
- push cx
- push dx
- push bp
- push si
- push di
- push es
-
- mov ax,0 ; arg for service routine
- push ax
- call ecint
- pop ax
- jmp doret
-
- ; ec1vec - Ethernet interrupt handler
- public ec1vec
- label ec1vec far
- push ds ; save on user stack
- mov ds,cs:dbase ; establish interrupt data segment
-
- mov Sssave,ss ; stash user stack context
- mov Spsave,sp
-
- mov ss,cs:dbase
- lea sp,Stktop
-
- push ax ; save user regs on interrupt stack
- push bx
- push cx
- push dx
- push bp
- push si
- push di
- push es
-
- mov ax,1 ; arg for service routine
- push ax
- call ecint
- pop ax
- jmp doret
-
- ; ec2vec - Ethernet interrupt handler
- public ec2vec
- label ec2vec far
- push ds ; save on user stack
- mov ds,cs:dbase ; establish interrupt data segment
-
- mov Sssave,ss ; stash user stack context
- mov Spsave,sp
-
- mov ss,cs:dbase
- lea sp,Stktop
-
- push ax ; save user regs on interrupt stack
- push bx
- push cx
- push dx
- push bp
- push si
- push di
- push es
-
- mov ax,2 ; arg for service routine
- push ax
- call ecint
- pop ax
- jmp doret
-
- ; fast buffer I/O routines -- used by 3-COM Ethernet controller
-
- ; outbuf - put a buffer to an output port
- public outbuf
- outbuf proc
- arg port:word,buf:ptr,cnt:word
- if @Datasize NE 0
- uses ds,si
- lds si,buf ; ds:si = buf
- else
- uses si
- mov si,buf ;ds:si = buf (ds already set)
- endif
- mov dx,port
- mov cx,cnt
- cld
- rep outsb ; works only on PC/AT (80286)
- ret
- outbuf endp
-
- ; inbuf - get a buffer from an input port
- public inbuf
- inbuf proc
- arg port:word,buf:ptr,cnt:word
- uses di
- if @Datasize NE 0
- les di,buf ; es:di = buf
- else
- mov di,buf ; es:di = buf
- mov ax,ds
- mov es,ax
- endif
- mov dx,port
- mov cx,cnt
- cld
- rep insb ; works only on PC/AT (80286)
- ret
- inbuf endp
-
- end
-
-